From 4d4fec207b472a7483483b99c3d94537b06cddad Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 3 Sep 2019 14:49:20 +0200 Subject: [PATCH] x86/HVM: ignore guest INVD uses The only place we'd expect the insn to be sensibly used is in (virtualization unaware) firmware. Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/emulate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index b61faf704b..7cd727ab97 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -2210,11 +2210,18 @@ static int hvmemul_cache_op( hvmemul_unmap_linear_addr(mapping, addr, 0, hvmemul_ctxt); /* fall through */ - case x86emul_invd: case x86emul_wbinvd: case x86emul_wbnoinvd: alternative_vcall(hvm_funcs.wbinvd_intercept); break; + + case x86emul_invd: + /* + * Deliberately ignored: We mustn't issue INVD, and issuing WBINVD + * wouldn't match the request. And the only place we'd expect the insn + * to be sensibly used is in (virtualization unaware) firmware. + */ + break; } return X86EMUL_OKAY; -- 2.30.2